﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int intN = -1;
            while (intN < 0) 
            {
                Console.Write("请输入行数(0表示结束）：");
                string strN = Console.ReadLine();
                int.TryParse(strN, out intN);
            }
            if (intN > 0) 
            {
                for (int i = 1; i <= intN; i++) 
                {
                    for (int j = 1; j < i; j++) 
                    {
                        Console.Write("*");
                    }
                    Console.WriteLine(" ");
                }
            }
            Console.WriteLine("按任意键结束");
            Console.ReadKey() ; 
        }
    }
}
